import { defineStore } from 'pinia'
import { ref, watch } from 'vue'
export const useProductStore = defineStore(
  'product',
  () => {
    const productId = ref(0)
    watch(
      () => productId.value,
      (value) => {
        productId.value = value
      },
    )
    return { productId }
  },
  {
    persist: {
      storage: sessionStorage,
      key: 'productId',
    },
  },
)
